<!-- $Id: third_customer_list.htm 2015-08-25 14:45:21Z langlibin $ -->

{if $full_page}
{include file="pageheader.htm"}
{insert_scripts files="../js/utils.js,listtable.js"}
<div class="form-div">
  <form action="javascript:searchCustomer()" name="searchForm">
    <img src="images/icon_search.gif" width="26" height="22" border="0" alt="SEARCH" />
    {$lang.cus_name} <input type="text" name="keyword" size="30" />
    <input type="submit" value="{$lang.button_search}" class="button" />
  </form>
</div>
<form method="POST" action="third_customer.php?act=batch_drop" name="listForm" onsubmit="return confirm('{$lang.batch_drop_confirm}')">
<!-- start cus list -->
<div class="list-div" id="listDiv">
{/if}

  <table cellpadding="3" cellspacing="1">
    <tr>
      <th><input onclick='listTable.selectAll(this, "checkboxes")' type="checkbox" />
      <a href="javascript:listTable.sort('cus_id'); ">{$lang.record_id}</a>{$sort_cus_id}</th>
      <th><a href="javascript:listTable.sort('cus_name'); ">{$lang.cus_name}</a>{$sort_cus_name}</th>
      <th><a href="javascript:listTable.sort('cus_no'); ">{$lang.cus_no}</a>{$sort_cus_no}</th>
      <th><a href="javascript:listTable.sort('cus_type'); ">{$lang.cus_type}</a>{$sort_cus_type}</th>
      <th><a href="javascript:listTable.sort('is_master'); ">{$lang.is_master}</a>{$sort_is_master}</th>
      <th><a href="javascript:listTable.sort('add_time'); ">{$lang.add_time}</a>{$sort_add_time}</th>
      <th>{$lang.handler}</th>
    </tr>

    {foreach from=$third_customer_list item=cus}
    <tr>
      <td><input value="{$cus.cus_id}" name="checkboxes[]" type="checkbox">{$cus.cus_id}</td>
      <td class="first-cell"><span onclick="javascript:listTable.edit(this, 'edit_cus_name', {$cus.cus_id})">{$cus.cus_name}</span></td>
      <td class="first-cell"><span onclick="javascript:listTable.edit(this, 'edit_cus_no', {$cus.cus_id})">{$cus.cus_no}</span></td>
      {if $cus.cus_type eq 0}
      <td align="center">{$lang.qq}</td>
      {else}
      <td align="center">{$lang.ww}</td>
      {/if}
      <td align="center"><img src="images/{if $cus.is_master}yes{else}no{/if}.gif" onclick="listTable.toggle(this, 'toggle_master', {$cus.cus_id})" /></td>
      <td align="center">{$cus.formated_add_time}</td>
      <td align="center">
        <a href="third_customer.php?act=edit&cus_id={$cus.cus_id}" title="{$lang.edit}"><img src="images/icon_edit.gif" border="0" height="16" width="16" /></a>
        <a href="javascript:;" onclick="listTable.remove({$cus.cus_id},'{$lang.drop_confirm}')" title="{$lang.remove}"><img src="images/icon_drop.gif" border="0" height="16" width="16" /></a>
      </td>
    </tr>
    {foreachelse}
    <tr><td class="no-records" colspan="10">{$lang.no_records}</td></tr>
    {/foreach}
  </table>

  <table cellpadding="4" cellspacing="0">
    <tr>
      <td><input type="submit" name="drop" id="btnSubmit" value="{$lang.drop}" class="button" disabled="true" /></td>
      <td align="right">{include file="page.htm"}</td>
    </tr>
  </table>

{if $full_page}
</div>
</form>

<script type="text/javascript" language="JavaScript">
listTable.recordCount = {$record_count};
listTable.pageCount = {$page_count};

{foreach from=$filter item=item key=key}
listTable.filter.{$key} = '{$item}';
{/foreach}
{literal}

/* 搜索三方客服 */
function searchCustomer()
{
   listTable.filter.keyword = Utils.trim(document.forms['searchForm'].elements['keyword'].value);
   listTable.filter.page = 1;
   listTable.loadList();
}

{/literal}
</script>
{include file="pagefooter.htm"}
{/if}